﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace 第二课堂评审系统.Models
{
    public class NoticeConfig : IEntityTypeConfiguration<Notice>
    {
        public void Configure(EntityTypeBuilder<Notice> builder)
        {
            builder.ToTable("T_Notice");
            builder.Property(n=>n.Article).HasMaxLength(25);
            builder.Property(n => n.picture).HasMaxLength(100);
            builder.HasOne(n => n.user).WithMany(n => n.notices);
        }
    }
}
